<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*,com.lexue.domain.*"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
  <head>
    <html:base />
    
    <title>searchResult.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <body>
          <table border="1">
          <tr><td>Teacher ID</td>
          <td>Teacher Name</td>
          <td>Teacher Gender</td>
          <td>Teacher City</td>
          <td>Teacher Area</td>
          <td>Teacher Subjects</td>
          <td>Teacher School</td>
          <td>Teacher Account</td></tr>
      <%List teachers =(List)request.getAttribute("result"); %>
      <%for(int i=0; teachers!=null && i<teachers.size();i++) {
      	TeacherInfo teacher = (TeacherInfo) teachers.get(i);
      %>
        <tr>
          <td><%=teacher.getTeacherId()%></td>
          <td><%=teacher.getTeacherName()%></td>
          <td><%=teacher.getSex()%></td>
          <td><%=teacher.getCity().getCityName() %></td>
          <td><%=teacher.getArea().getAreaName() %></td>
          <td><%Iterator it = teacher.getSubjects().iterator();
			while(it.hasNext())
			{%>
			
			<%=((Subject)it.next()).getSubjectName()%>
			
			<%}
            %></td>    
           <td><%=teacher.getSchool() %></td>  
           <td><%= teacher.getSysUser().getUserAccount() %></td>
        </tr>
      <%} %>  
	</table>
	
</body>
</html:html>
